#include "Model.h"

Model::Model()
{

}

Model::Model(std::string name, std::string type, std::string rg, std::string hp, std::string tw)
{
	//	_logLine = new_logLine;
	//Entry = newEntry;
	_name = name;
	_type = type;
//	Callnum = newCallnum;
	_retractableGear = rg;
	_horsePower = hp;
	_tailWheel = tw;
	_numberPlanes = -1;
	_flights = 0;
	_dayHours = 0;
	_nightHours = 0;
	_ifrHours = 0;
	_gadHours = 0;
	_xcHours = 0;
	_cfiHours = 0;
	_dualHours = 0;
	_picHours = 0;
	_sicHours = 0;
	_safetyHours = 0;
//	RgHours = 0;
//	HpHours = 0;
//	TwHours = 0;
}

Model::~Model()
{

}

//std::string Model::get_logLine()
//{
//	return _logLine;
//}

//std::string Model::getEntry()
//{
//	return Entry;
//}

//std::string Model::getCallnum()
//{
//	return Callnum;
//}

std::string Model::name() const
{
	return _name;
}

std::string Model::type() const
{
	return _type;
}

std::string Model::retractableGear() const
{
	return _retractableGear;
}

std::string Model::horsePower() const
{
	return _horsePower;
}

std::string Model::tailWheel() const
{
	return _tailWheel;
}  

int Model::numberPlanes() const
{
	return _numberPlanes;
}

std::string Model::firstDate() const
{
	return _firstDate;
}

std::string Model::lastDate() const
{
	return _lastDate;
}

double Model::flights() const
{
	return _flights;
}

double Model::dayHours() const
{
	return _dayHours;
}

double Model::nightHours() const
{
	return _nightHours;
}

double Model::ifrHours() const
{
	return _ifrHours;
}

double Model::gadHours() const
{
	return _gadHours;
}

double Model::xcHours() const
{
	return _xcHours;
}

double Model::cfiHours() const
{
	return _cfiHours;
}  

double Model::dualHours() const
{
	return _dualHours;
}

double Model::picHours() const
{
	return _picHours;
}

double Model::sicHours() const
{
	return _sicHours;
}
  
double Model::safetyHours() const
{
	return _safetyHours;
}

//double Model::getRgHours()
//{
//	return RgHours;
//}

//double Model::getHpHours()
//{
//	return HpHours;
//}

//double Model::getTwHours()
//{
//	return TwHours;
//}

void Model::setModel(std::string newType, std::string newModel, std::string newRg, std::string newHp, std::string newTw)
{
//	_logLine = new_logLine;
//	Entry = newEntry;
//	Type = newType;
//	Model = newModel;
//	Callnum = newCallnum;
	//Rg = newRg;
	//Hp = newHp;
	//Tw = newTw;
	//NumPlanes = -1;
	//Flights = 0;
	//Hours = 0;
	//Night = 0;
	//Ifr = 0;
	//Gad = 0;
	//Xc = 0;
	//Cfi = 0;
	//Dual = 0;
	//Pic = 0;
	//Sic = 0;
	//Sft = 0;
//	RgHours = 0;
//	HpHours = 0;
//	TwHours = 0;
}

void Model::addLogEntry(std::string Date, int PlaneIndex, double newHours, double newNight, double newIfr, double newGad, double newXc, double newCfi,
						 double newDual, double newPic, double newSic, double newSft)
{
	if (_flights == 0)
		_firstDate = Date;
	_lastDate = Date;
	if (_numberPlanes != 10000)
		{
		if (_numberPlanes == -1)
			_numberPlanes = PlaneIndex;
		if (_numberPlanes != PlaneIndex)
			_numberPlanes = 10000;
		}
	_flights += 1;
	_dayHours += newHours;
	_nightHours += newNight;
	_ifrHours += newIfr;
	_gadHours += newGad;
	_xcHours += newXc;
	_cfiHours += newCfi;
	_dualHours += newDual;
	_picHours += newPic;
	_sicHours += newSic;
	_safetyHours += newSft;
//	if (Entry == "type" || Entry == "totals")
//		{
//		if (newRg == "RG")
//			RgHours += newHours;
//		if (newHp == "HP")
//			HpHours += newHours;
//		if (newTw == "TW")
//			TwHours += newHours;
//		}
}
